package com.wzh.navcode.mapstruct;

import com.wzh.navcode.domain.entity.HotData;
import com.wzh.navcode.domain.vo.WeiBoHotTopic;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * @Author: wangzh
 * @Version: 1.0
 * @Description:
 */
@Mapper
public interface WeiBoHotTopicMapstruct {
    WeiBoHotTopicMapstruct INSTANCE = Mappers.getMapper(WeiBoHotTopicMapstruct.class);

    @Mappings({
            @Mapping(target = "hotValue", expression = "java(com.wzh.navcode.utils.TextUtils.formatText(weiBoHotTopics.getHot()))"),
            @Mapping(target = "platform", constant = "微博")
    })
    HotData weiBoHotTopicMapstruct(WeiBoHotTopic weiBoHotTopics);
}
